<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Dashboard Template for Bootstrap</title>
		<link rel="stylesheet" type="text/css" href="/xiaomi/Public/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="/xiaomi/Public/css/type.css" />
	

	</head>

	<body class="index_body">

		<!--*****************************************导航栏*****************************************************-->
		<nav class="navbar navbar-inverse navbar-fixed-top">
			<div class="container-fluid">
				<!--小米商城名称以及隐藏内容按钮-->
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
			        <span class="sr-only"></span>
			        <span class="icon-bar"></span>
			        <span class="icon-bar"></span>
			        <span class="icon-bar"></span>
			    </button>
					<a class="navbar-brand" href="#">小米商城</a>
				</div>
				<!--下拉导航-->
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li class="active">
							<a href="/xiaomi/index.php?s=/Home/Index/index.html">首页</a>
						</li>
						<li class="dropdown">
							<a href="/xiaomi/index.php?s=/Home/Index/classify.html">分类</a>
						</li>
						<li class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
								我的 <span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li>
									<a href="/xiaomi/index.php?s=/Home/Cart/index.html">购物车</a>
								</li>
								<li>
									<a href="/xiaomi/index.php?s=/Home/User/order.html">订单</a>
								</li>
								<li>
									<a href="/xiaomi/index.php?s=/Home/User/personalInfo">信息</a>
								</li>
							</ul>
						</li>
					</ul>
					<!--搜索条-->
					<form class="navbar-form navbar-right">
						<div class="form-group has-feedback">
							<span class="glyphicon glyphicon-search form-control-feedback"></span>
							<input type="text" class="form-control" placeholder="Search for..." autofocus>
						</div>
					</form>
					<!--登陆注册连接-->
					<ul class="nav navbar-nav navbar-right">
					    <li>
							<?php if(($_SESSION['userName']) != ""): ?><a>欢迎您，<?php echo (session('userName')); ?></a><?php endif; ?>
						</li>
						<li>
							<a href="/xiaomi/index.php?s=/Home/User/login">登陆</a>
						</li>
						<li>
							<a href="/xiaomi/index.php?s=/Home/User/register">注册</a>
							<!-- "/xiaomi/index.php?s=/Admin/Controller/action" -->
						</li>
					</ul>
				</div>
			</div>
		</nav>
		<!doctype html>
<html lang="en">

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Dashboard Template for Bootstrap</title>
		<link rel="stylesheet" type="text/css" href="/xiaomi/Public/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="/xiaomi/Public/css/type.css" />
		<script type="text/javascript" src="/xiaomi/Public/js/jquery.min.js"></script>
		<script type="text/javascript" src="/xiaomi/Public/js/bootstrap.min.js"></script>
		<style type="text/css">
			.cart-items {
				width: 70%;
				margin-right: 5%;
			}
			
			.cart_span1 {
				font-size: 16px;
			}
			
			.cart_span2 {
				font-size: 14px;
				color: #ADADAD;
			}
			
			.cart_span3 {
				color: #FB741F;
				font-size: 14px;
			}
			
			.cart-header {
				position: relative;
			}
			
			.cart-header2 {
				position: relative;
				clear:leftl;
			}
			/*del*/
			
			.close1,
			.close2 {
				background: url('/xiaomi/Public/images/cart/close_1.png') no-repeat 0px 0px;
				cursor: pointer;
				width: 28px;
				height: 28px;
				position: absolute;
				right: 0px;
				top: 0px;
			}
			/*信息位置*/
			
			.cart-item {
				width: 20%;
				float: left;
				margin-right: 5%;
			}
			
			a.continue {
				background: #5B88BB;
				padding: 10px 20px;
				font-size: 1em;
				color: #000;
				text-decoration: none;
				display: block;
				text-align: center;
				margin-bottom: 2em;
			}
			
			.price-details {
				border-bottom: 1px solid #DDD9D9;
				padding-bottom: 10px;
			}
			/*右边列表*/
			
			.price-details span {
				width: 50%;
				float: left;
				font-size: 1em;
				color: #000;
				line-height: 1.8em;
				text-align: center;
			}
			
			.cart_total {
				text-align: center;
			}
			/*--responsive design--*/
			
			@media (max-width:1024px) {
				.cart-items {
					width: 100%;
					margin-right: 0;
				}
			}
			
			/*购物车列表样式*/
			.cart{
			     clear:left;
			     list-type:none;
			}
			.cart li{
			      width:100px;
			}
		</style>
	</head>

	<body>
		<header>
			<div class="col-md-12 col-xs-12">
				<div class="col-md-4 col-xs-3"></div>
				<div class="col-md-4 col-xs-6 text-center">
					<h2>购物车</h2></div>
				<div class="col-md-4 col-xs-3"></div>
			</div>
			<div class="col-md-12 col-xs-12">
				<div class="col-md-1"></div>
				<div class="col-md-10 col-xs-12">
					<hr style="border: groove #ddd 1px;">
				</div>
				<div class="col-md-1"></div>
			</div>
		</header>
		<?php if(($cart) != ""): ?><form method="post" action="/xiaomi/index.php?s=/Home/User/addorder">
		<section>
			<div class="col-md-1"></div>
			<div class="container col-md-10 col-xs-12">
				<div class="check_box">
					<div class="col-md-8 cart-items ">
		            
						<script>
							$(document).ready(function(c) {
								$('.close2').on('click', function(c) {
									$('.cart-header2').fadeOut('slow', function(c) {
										$('.cart-header2').remove();
									});
								});
var total=0;
for(var i=0;i<$(".price").length;i++){
	total+=parseInt($(".price:eq("+i+")").val())*parseInt($(".count:eq("+i+")").val());
}
$("#total").text(total);
$("#totalmoney").val(total);
								
							});
						</script>
						<div class="cart-header2">
							
							<?php if(is_array($cart)): foreach($cart as $key=>$c): ?><div class="cart-sec">
								<div class="cart-item">
									<img src="/xiaomi/Public/uploads/img/<?php echo ($c["PictureUrl"]); ?>" class="img-responsive" alt="" />
								</div>
								
								<div class="cart_info">
								<input type="hidden" value="<?php echo ($c["GoodId"]); ?>" name="GoodId[]"/>
									<span class="cart_span1"><a href="#"><?php echo ($c["GoodName"]); ?></a></span><br><input type="hidden" value="<?php echo ($c["GoodName"]); ?>" name="GoodName[]"/>
									<div class="col-md-3 col-xs-3 index_span2">
										<span class="cart_span2"><?php echo ($c["Color"]); ?></span><br><input type="hidden" value="<?php echo ($c["Color"]); ?>" name="Color[]"/>
										<span class="cart_span2"><?php echo ($c["Version"]); ?></span><input type="hidden" value="<?php echo ($c["Version"]); ?>" name="Version[]"/>
										
									</div>
									<div class="col-md-1 col-xs-1"></div>
									<div>
										<input type="text" class="col-md-3 col-xs-3" value="<?php echo ($c["Count"]); ?>" readonly/><input type="hidden" value="<?php echo ($c["Count"]); ?>" name="GoodCount[]" class="count"/>
									</div>
									<div class="col-md-1 col-xs-1"></div>
									<div class="col-md-2 col-xs-3 index_span3">
										<span class="cart_span3"> <?php echo ($c["Price"]); ?></span><input type="hidden" value="<?php echo ($c["Price"]); ?>" name="Price[]" class="price"/>
									</div>
									<div class="col-md-2 col-xs-3 index_span3">
										<span class="cart_span3"><a href="/xiaomi/index.php?s=/Home/Cart/del/gid/<?php echo ($c["GoodId"]); ?>/userId/<?php echo ($c["user_UserId"]); ?>/color/<?php echo ($c["Color"]); ?>/version/<?php echo ($c["Version"]); ?>">删除</a></span>
									</div>
									<div class="clearfix"></div>
								</div>
								
							</div><?php endforeach; endif; ?>

						</div>
					</div>
				</div>

				<div class="col-md-3">
					<a class="continue" href="#">价格明细</a>
					
					<div class="price-details">

						<span>总价：</span>
						<span id="total"></span>
<input type="hidden" value="" name="TotalMoney" id="totalmoney"/>
						<div class="clearfix"></div>
					</div>
					
				</div>
				<div class="col-md-1"></div>
		</section>
		<div class="col-md-12 col-xs-12">
			<div class="col-md-4"></div>
			<div class="col-md-4 cart_total"><button type="submit" class="btn btn-primary" >提交订单</button></div>
			<div class="col-md-4"></div>
		</div>
</form><?php endif; ?>
<?php if(($cart) == ""): ?><center><h2>还没有添加商品，快去采购吧~</h2></center><?php endif; ?>
	</body>

</html>
	
</body>
</html>